<template>
  <div class="paymenTrecord">
    <Header title="会员缴费记录查询" />
    <div class="dateSelect">
      <div class="dateStartBox" @click="show = true">
        <div class="dateStart">{{ startDate }}</div>
        <div class="calendar">
          <img src="../assets/日历.png" alt="" />
        </div>
      </div>
      <span>一</span>
      <div class="dateStopBox" @click="show = true">
        <div class="dateStop">{{ stopDate }}</div>
        <div class="calendar">
          <img src="../assets/日历.png" alt="" />
        </div>
      </div>
    </div>
    <div class="cost">
      <span>期费</span>
      <select>
        <option value="" selected="selected"></option>
        <option value="volvo">Volvo</option>
        <option value="saab">Saab</option>
        <option value="opel">Opel</option>
        <option value="audi">Audi</option>
      </select>
    </div>
    <div class="costTable">
      <div class="table">
        <div class="tableHander">
          <div class="item">期费</div>
          <div class="item">订单号</div>
          <div class="item">金额</div>
          <div class="item">缴纳时间</div>
        </div>
        <table border="0">
          <tr v-for="item in 3" :key="item" >
            <td>2021年</td>
            <td>2019080701</td>
            <td>￥23.75</td>
            <td>2020-08-07</td>
          </tr>
        </table>
      </div>
    </div>

    <van-calendar
      v-model="show"
      type="range"
      :min-date="minDate"
      :max-date="maxDate"
      @confirm="onConfirm"
    />
  </div>
</template>

<script>
import Header from "../components/header";
export default {
  name: "paymenTrecord",
  data() {
    return {
      show: false,
      startDate: "请选择日期 (起)",
      stopDate: "请选择日期 (止)",
      minDate: new Date(2010, 0, 1),
      maxDate: new Date(2021, 0, 31),
    };
  },
  components: {
    Header,
  },
  methods: {
    formatDate(date) {
      return `${date.getFullYear()}年${date.getMonth() + 1}月${date.getDate()}`;
    },
    onConfirm(date) {
      const [start, end] = date;
      this.show = false;
      this.startDate = this.formatDate(start);
      this.stopDate = this.formatDate(end);
    },
  },
};
</script>

<style lang="less">
// 未缴纳会费
.paymenTrecord {
  .noMembership {
    margin-top: 10px;
    .noTitle {
      width: 120px;
      text-align: center;
      font-size: 20px;
      font-weight: 600;
      color: #333333;
      border-bottom: 3px solid #333333;
    }
    .table {
      .tableHander {
        width: 375px;
        display: flex;
        height: 30px;
        line-height: 30px;
        .item {
          flex: 1;
          text-align: center;
        }
        border-bottom: 1px solid #cccccc;
        margin-bottom: 3px;
      }
      table {
        width: 100%;
        border-top: 1px;
        tr {
          width: 100%;
          text-align: center;
          td {
            height: 30px;
          }
        }
      }
      .MembershipBtn {
        display: flex;
        justify-content: flex-end;
        button {
          width: 60px;
          height: 30px;
          background: #169bd5;
          color: #fff;
          border-radius: 4px;
          margin-right: 25px;
        }
      }
    }
  }
  .dateSelect {
    display: flex;
    align-items: center;
    padding: 0 20px 0 20px;
    .dateStartBox {
      display: flex;
      align-items: center;
      flex: 1;
      .dateStart {
        flex: 1;
        align-items: center;
        text-align: center;
        font-size: 15px;
        color: #cccccc;
      }
      .calendar {
        img {
          width: 30px;
        }
      }
    }
    .dateStopBox {
      display: flex;
      align-items: center;
      flex: 1;
      .dateStop {
        flex: 1;
        align-items: center;
        text-align: center;
        font-size: 15px;
        color: #cccccc;
      }
      .calendar {
        img {
          width: 30px;
        }
      }
    }
  }
  .cost {
    span {
      margin-right: 10px;
    }
  }
  .costTable {
    margin-top: 10px;
    .table {
      .tableHander {
        width: 375px;
        display: flex;
        height: 30px;
        line-height: 30px;
        .item {
          flex: 1;
          text-align: center;
        }
        border-bottom: 1px solid #cccccc;
        margin-bottom: 3px;
      }
      table {
        width: 100%;
        border-top: 1px;
        tr {
          width: 100%;
          text-align: center;
          display: flex;
          border-bottom: 1px solid #000;
          td {
            height: 30px;
            flex: 1;
            line-height: 30px;
          }
        }
      }
    }
  }
}
</style>